@extends('layouts.admin')
@section('title')

@endsection
@section('content')
@include('package.nav')

<table class="table table-bordered mt-3 shadow-sm">
    <thead>
        <tr>

            <th width='80'>编号</th>
            <th width='300'>套餐名称</th>
            <th>包含模块</th>
            <th>用户组</th>
            <th width='150'>操作</th>

        </tr>
    </thead>
    <tbody>
        @foreach ($packages as $package)
        <tr>
            <td>{{$package['id']}}</td>
            <td>{{$package['title']}}</td>
            <td>
                @foreach ($package->modules as $module)
                <a href="{{ route('admin.package.edit',$package) }}"
                    class=' badge badge-success'>{{$module['title']}}</a>
                @endforeach
            </td>
            <td>
                @foreach ($package->groups as $group)
                <a href="{{ route('admin.group.edit',$group) }}" class=' badge badge-success'>{{$group['title']}}</a>
                @endforeach
            </td>
            <td>
                <div class="btn-group btn-group-sm" role="group">
                    <a href="{{route('admin.package.edit',$package)}}" class="btn btn-info">编辑</a>
                    @if($package['id']>1)
                    <btn-del   class-name="btn btn-danger btn-sm" action='{{ route('admin.package.destroy',$package) }}'>刪除</btn-del>
                    @endif
                </div>
            </td>
        </tr>
        @endforeach
    </tbody>
</table>
@endsection
